package cn.thr.ymcc.client;

import cn.thr.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseUserLearnClientFallbackFactory implements FallbackFactory<CourseUserLearnClient> {
    @Override
    public CourseUserLearnClient create(Throwable throwable) {

        return new CourseUserLearnClient() {
            @Override
            public JsonResult CourseUserLearnController(Long loginId, Long courseId) {
                throwable.printStackTrace();
                return JsonResult.error("课程服务 CourseUserLearnClient 调用时报"+throwable.getMessage());
            }
        };
    }
}
